package com.example.javafx;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.stage.Stage;

public class HelloController {
    private Stage stage;

    @FXML
    private Label welcomeText;

    public void start(Stage stage){
        this.stage = stage;
    }

    @FXML
    protected void onHelloButtonClick() {
        welcomeText.setText(welcomeText.getText() == "" ? "Welcome to JavaFX Application!" : "");
    }

    // 有个问题没处理
    @FXML
    protected void closeClick() {
        stage.close();
    }
}